import java.io.*;

public class Test14 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\Java\\test14.txt";

        FileWriter out = new FileWriter(fileName);

        out.write("Hello Java!\n");
        out.write("安徽理工大学\n");
        out.close();

        FileReader in = new FileReader(fileName);

        int c = in.read();

        while (c != -1) {
            System.out.println((char)c);
            c = in.read();
        }

        in.close();
    }
}
